<?php

namespace App\Http\Controllers\System;

use App\Http\Controllers\Controller;
use App\Models\System\SystemOperationLog;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class SystemOperationLogController extends Controller
{
    protected Request $request;
    protected Model $model;

    public function __construct(Request $request,SystemOperationLog $systemOperationLog)
    {
        $this->request=$request;
        $this->model = $systemOperationLog;
    }

    /**
     * Display a listing of the resource.
     */
    public function index():JsonResponse
    {
        $perPage=$this->request->per_page??10;
        $list=$this->model->modelSearch($this->request,$this->model)
            ->with(['strator'])
            ->orderByDesc('id')
            ->paginate($perPage);
        $this->saveOperationLog('查询操作日志列表');
        return $this->success($list);
    }


}
